from django.db import models
from django.contrib.auth.models import AbstractUser

# Create your models here.
class Roles(models.Model):
    role = models.CharField(max_length=100)
    class meta:
        db_table = 'roles'

    def __str__(self):
        return self.role

class MyUser(AbstractUser):
    role = models.ForeignKey(Roles)
    user_head_img = models.ImageField(upload_to="uploads/user_head_img",verbose_name=u'头像')

    class meta:
        db_table = 'myuser'

    def __str__(self):
        return self.username
